package com.qianfeng.openapi.search.listener;

import com.qianfeng.openapi.search.service.SearchService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2021/1/5
 * @Time: 上午10:45
 */
@Component
public class MessageListener {
    @Resource
    private SearchService searchService;

    @RabbitListener(queues = "gateway_log")
    public  void  onMessage(String message){
        System.out.println("----->搜索模块，监听到消息"+message);
        //处理数据
        searchService.addData(message);
    }

}
